package com.checx.override;

import com.checx.loader.MyClassLoader;

public class Main {
    public static void main(String[] args) throws Exception {
        // <Main, AppClassLoader> <Spoofed, AppClassLoader> <Super, AppClassLoader> <Sub, MyClassLoader>
        Spoofed spoofed = new Spoofed();
        MyClassLoader myClassLoader = new MyClassLoader("./classes");
        Class<?> cls = myClassLoader.loadClass("com.checx.override.Sub");
        System.out.println("Sub's class loader: " + cls.getClassLoader());
        Object sub = cls.newInstance();
        Super duper = (Super) sub;
        duper.f(spoofed);
    }
}
